package com.zixuan.gulicollege.msmservice.controller;

import com.zixuan.gulicollege.common_utils.R;
import com.zixuan.gulicollege.msmservice.config.MsmConfig;
import com.zixuan.gulicollege.msmservice.service.MsmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName MsmController
 * @Author by zixuan
 * @Date 2021/5/18 9:48
 */
@RestController
@RequestMapping("/msm_service/msm")
public class MsmController {

    @Autowired
    private MsmService msmService;

    /**
     * 获取验证码
     * @param phoneNum 手机号
     * @return 返回状态
     */
    @GetMapping("/getPhoneCode/{phoneNum}")
    public R getPhoneCode(@PathVariable String phoneNum) {

        msmService.getPhoneCode
                (
                        MsmConfig.APP_CODE,
                        MsmConfig.HOST,
                        MsmConfig.PATH,
                        MsmConfig.METHOD,
                        MsmConfig.TEMPLATE_ID,
                        MsmConfig.EXPIRE_AT,
                        phoneNum
                );

        return R.ok();
    }

}
